package net.myjung.spring;

import java.util.ArrayList;
import java.util.List;

import net.myjung.model.BaseObject;
import net.myjung.model.annotation.MdlAttribute;
import net.myjung.model.annotation.MdlClass;
import net.myjung.model.annotation.MdlElement;

@MdlClass(name = "Beans")
@SuppressWarnings("serial")
public class SprBeans extends BaseObject {
	@MdlAttribute(type = "string")
	private String xmlns;
	@MdlAttribute(name = "xmlns:xsi", type = "string")
	private String xmlns_xsi;
	@MdlAttribute(name = "xsi:schemaLocation", type = "string")
	private String xsi_schemaLocation;
	@MdlElement(type = "net.myjung.spring.Bean")
	private List<SprBean> bean;

	public SprBeans() {
		super();
		xmlns = "http://www.springframework.org/schema/beans";
		xmlns_xsi = "http://www.w3.org/2001/XMLSchema-instance";
		xsi_schemaLocation = "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd";
	}

	public String getXmlns() {
		return xmlns;
	}
	public void setXmlns(String xmlns) {
		this.xmlns = xmlns;
	}
	public String getXmlns_xsi() {
		return xmlns_xsi;
	}
	public void setXmlns_xsi(String xmlns_xsi) {
		this.xmlns_xsi = xmlns_xsi;
	}
	public String getXsi_schemaLocation() {
		return xsi_schemaLocation;
	}
	public void setXsi_schemaLocation(String xsi_schemaLocation) {
		this.xsi_schemaLocation = xsi_schemaLocation;
	}
	public List<SprBean> getBean() {
		return bean;
	}
	public void setBean(List<SprBean> bean) {
		this.bean = bean;
	}
	public void addBean(SprBean bean) {
		if (this.bean == null)
			this.bean = new ArrayList<SprBean>();
		this.bean.add(bean);
	}
	public void removeBean(SprBean bean) {
		if (this.bean == null || !this.bean.contains(bean))
			return;
		this.bean.remove(bean);
	}
}